package com.xiaoihu.server;

import com.xiaoihu.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;


/**
 * @Author: xiaoihu
 * @Description: 操作员工具类
 * @Date Created in 2022-04-15 10:52
 * @Modified By:
 */

public class AdminUtils {

    /**
     * 获取当前操作员
     * @return
     */
    public static Admin getCurrentAdmin(){
        return (Admin)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
